import request from './request'
import qs from 'qs'
// 请求精品推荐数据
export const JingpinAPI = () => request.get('/products/recommend')


// 热门兑换
export const ReMenAPI = () => request.get('/products/hot')

// 发送短信验证码
export const SendSMSAPI = (params) => request.post('/sendSMS',qs.stringify(params))

export const PhoneReginAPI = (params) => request.post('/phoneRegin',qs.stringify(params))

export const WeixinLoginApi = (params) => request.post(`/wechatUsers/PCLogin`, qs.stringify(params));

//手机绑定微信请求
export const BindPhoneAPI = (params) => request.post(`/wechatUsers/binding`,qs.stringify(params));

// 获取登录用户信息
export const UserProfilesAPI = () => request.get("/shop/userProfiles");

// 请求详情页的数据
export const GoodDetailsAPI = (id) => request.get(`/products/${id}`);

// 加入到购物车
export const AddToCartApi = (params) => request.post(`/shop/carts/add`, qs.stringify(params))

// 商品搜索（含首页的“更多”）
export const GoodsSearchApi = (params) => request.get(`/products`, {params});

// 查看购物车
export const myCartsAPI = (params) => request.get("/shop/carts",{params})

// 删除购物车
export const deleteCartAPI = (id) => request.delete(`/shop/carts?${qs.stringify(id)}`)